using System;
using Castle.ActiveRecord;
using CosyTrade.Data;

namespace CosyTrade.Distribution
{
    [AddPropertyChangedNotifyInterface,PropertyChangedNotify]
    [Serializable,ActiveRecord("tbRegion"),JoinedBase]
    public class RegionBase : BusinessObject
    {
        private readonly Guid primaryKey = Guid.NewGuid();
        private string captionChina;
        private string captionSpain;
        private Guid parentRegionGuid = Guid.Empty;
        
        [PrimaryKey(PrimaryKeyType.Assigned,"ROWGUID",Access = PropertyAccess.NosetterCamelcase)]
        public Guid PrimaryKey
        {
            get { return primaryKey; }
        }

        [Property]
        public string ChinaCaption
        {
            get { return captionChina; }
            set { captionChina = value; }
        }

        [Property]
        public string SpainCaption
        {
            get { return captionSpain; }
            set { captionSpain = value; }
        }

        [Property]
        public Guid ParentRegionGuid
        {
            get { return parentRegionGuid; }
            set { parentRegionGuid = value; }
        }
    }
}